<template>
    <div id="app">
        <!--    <add-func :num1="num1" :num2="num2" v-on:getSumFromChild="receiveChildSum"></add-func>-->
        <color-red></color-red>
        <form-coll :formData="formData" @inputsData="getInputsData"></form-coll>
        <router-link to="/mapView">地图</router-link>
        <router-link to="/taiyuan">太原地图</router-link>
    </div>
</template>

<script>

    export default {
        name: 'App',
        components: {
        },
        data(){
            return{
                num1: 4,
                num2: 5,
                sumFromChild:0,
                formData:[
                    {formType:'aDate',placeholder:'请选择',initValue:'',prop:'date',name:'日期'},
                    {formType:'aInput',placeholder:'请选择',initValue:'',prop:'name',name:'姓名'},
                    {formType:'aRadio',initValue:'',prop:'sex',name:'单选',radioLable:[{value:0,lable:'男'},{value:1,lable:'女'}]},
                    {formType:'aSelect',placeholder:'请选择',initValue:'',prop:'type',name:'类型选择',selectLable:[{value:0,lable:'aInput'},{value:1,lable:'aRadio'}]},
                ],//表单数据 formType：表单类型 placeholder：表单提示，initValue：初始值 prop：绑定的字段 ，name：表单名
            }
        },
        methods:{
            receiveChildSum(sum){ //自定义事件，接收子组件的和
                this.sumFromChild = sum;
            },
            getInputsData(value){
                console.log(value)
            }
        }
    }
</script>

<style>
    #app {
        padding: 20px;
    }
</style>
